Skip to content

Add mcp-youtube MCP server for downloading YouTube subtitles - #3

Open
RiCSaucd wants to merge 2 commits into
mainfrom
claude/mcp-youtube-downloader-rdx1ip
Open

Add mcp-youtube MCP server for downloading YouTube subtitles#3
RiCSaucd wants to merge 2 commits into
mainfrom
claude/mcp-youtube-downloader-rdx1ip

Conversation

@RiCSaucd

@RiCSaucd RiCSaucd commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the @anaisbetts/mcp-youtube package (v0.7.3) as a new mcp-youtube/ project: a Model Context Protocol stdio server that lets Claude read YouTube video subtitles so it can summarize and answer questions about video content.

What's included

  • src/index.ts — MCP server exposing a single download_youtube_url tool. It runs yt-dlp to fetch English subtitles (manual or auto-generated, converted to SRT) into a temp directory, cleans out WEBVTT headers, timing lines, sequence numbers, inline tags, and duplicated auto-caption cues, and returns the transcript text. Temp files are cleaned up with rimraf in all paths.
  • test/strip-vtt-noise.test.ts — Bun tests for the subtitle-cleaning helper (4 passing).
  • package.json — as specified in the task, with "type": "module" added so the ESM build runs under Node.
  • tsconfig.json, README.md (install/usage docs incl. yt-dlp prerequisite), .gitignore, bun.lock.

Verification

  • bun test: 4 pass, 0 fail
  • bun build --target node src/index.ts --outdir dist succeeds
  • Smoke-tested the built server over stdio: initialize + tools/list correctly returns the download_youtube_url tool

🤖 Generated with Claude Code

https://claude.ai/code/session_01UDZyqVgbhHovtSKV4gzyRh


Generated by Claude Code

Implements the @anaisbetts/mcp-youtube package: an MCP stdio server
exposing a download_youtube_url tool that fetches English subtitles
via yt-dlp, strips VTT/SRT timing and markup noise, and returns the
transcript so Claude can summarize YouTube videos.

Includes bun tests for the subtitle cleaner, tsconfig, and README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDZyqVgbhHovtSKV4gzyRh
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b917e892-66d5-45b5-a6ab-2f176c6813b8


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RiCSaucd
RiCSaucd marked this pull request as ready for review August 17, 2026 03:29
Copilot AI lite review requested due to automatic review settings August 17, 2026 03:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new standalone mcp-youtube/ MCP stdio server package that downloads and cleans YouTube subtitles via yt-dlp, enabling downstream clients to consume transcript text.

Changes:

  • Introduces an MCP server with a download_youtube_url tool that invokes yt-dlp and returns cleaned subtitle text.
  • Adds stripVttNoise subtitle-cleaning helper with Bun unit tests.
  • Adds package scaffolding (README, tsconfig, lockfile, gitignore) for publishing/building.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
mcp-youtube/src/index.ts Implements MCP server tool and subtitle-cleaning helper.
mcp-youtube/test/strip-vtt-noise.test.ts Adds Bun tests for subtitle-cleaning behavior.
mcp-youtube/package.json Defines package metadata, bin entry, deps, and scripts.
mcp-youtube/tsconfig.json TypeScript configuration for the project.
mcp-youtube/README.md Documents usage, prerequisites, and development commands.
mcp-youtube/bun.lock Locks dependency versions for Bun.
mcp-youtube/.gitignore Ignores build output and node_modules.
Suppressed comments (1)

mcp-youtube/src/index.ts:144

  • This entrypoint check is fragile when process.argv[1] is relative. Resolve argv[1] and convert it to a file URL before comparing to import.meta.url.
if (import.meta.url === `file://${process.argv[1]}`) {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread mcp-youtube/src/index.ts Outdated
Comment thread mcp-youtube/src/index.ts
Comment thread mcp-youtube/src/index.ts
Comment thread mcp-youtube/src/index.ts
Comment thread mcp-youtube/src/index.ts Outdated
Comment thread mcp-youtube/src/index.ts Outdated
Comment thread mcp-youtube/src/index.ts Outdated
Comment thread mcp-youtube/package.json
Comment thread mcp-youtube/package.json
- Validate the input URL is an http(s) YouTube URL before invoking yt-dlp
- Collapse only consecutive duplicate subtitle lines so legitimately
  repeated phrases later in the transcript are preserved
- Filter temp-dir reads to .srt/.vtt files and return an error instead of
  an empty success when no subtitles were downloaded
- Fix the direct-execution guard to compare against pathToFileURL(argv[1])
  so the server starts reliably via node/npx with relative paths
- Run yt-dlp non-detached to avoid orphaned processes
- Reword the error message (subtitles, not video) and make the tool
  description client-agnostic
- Use prepublishOnly instead of the legacy prepublish hook
- Pin bun-types to ^1.3.14 instead of latest

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDZyqVgbhHovtSKV4gzyRh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants